package cn.kgc.tangcco.controller;

import cn.kgc.tangcco.model.ResultCode;
import cn.kgc.tangcco.pojo.User;
import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author 李昊哲
 * @Description
 * @create 2020/9/6 上午10:05
 */
@Controller
@RequestMapping(value = "/user")
public class UserController {

    @RequestMapping(value = "/register")
    public String register(Model model, User user) {
        System.out.println(JSON.toJSONString(user));
        // 存储参数
        model.addAttribute("code", ResultCode.SUCCESS.getCode());
        model.addAttribute("user", user);
        return "/regSuccess.jsp";
    }
}
